package com.hnevc.netfoodchoose;
import java.util.ArrayList;
import java.util.List;

import okhttp3.Cookie;
import okhttp3.CookieJar;
import okhttp3.HttpUrl;


import static android.R.string.ok;

/**
 * Created by Administrator on 2017/11/8.
 */

public class MyCookjejar implements CookieJar {
    //使用静态变量，维护Cookie
    public static List <Cookie> sCookies = new ArrayList<>();

    @Override
    public void saveFromResponse(HttpUrl url, List<Cookie> cookies) {
        sCookies = cookies;
    }

    @Override
    public List<Cookie> loadForRequest(HttpUrl url) {
        return sCookies;
    }
}
